import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.0

ApplicationWindow {
	id: window

	width: 640
	height: 480

	title: "oglq"

	StackView {
		id: stackView
		anchors.fill: parent

		initialItem: MainPage {
			item: {"uri": "/", "title": "Library"}
			isRoot: true

			onItemSelected: {
				stackView.push(mainPage, {item: data});
			}
		}
	}

	Component.onCompleted: {
		show();
	}

	Component {
		id: mainPage
		MainPage {
			isRoot: false
			onClosed: {
				stackView.pop();
			}
			onItemSelected: {
				stackView.push(mainPage, {item: data});
			}
		}
	}
}
